/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.entity;

import com.jeeplus.modules.sys.entity.Office;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.modules.fee.entity.Consignor;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 计费协议Entity
 * @author weisong
 * @version 2017-09-18
 */
public class Agreement extends DataEntity<Agreement> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 协议名称
	private String number;		// 协议编号
	private Office office;		// 机构
	private Integer currency;		// 货币种类
	private Date startDate;		// 生效时间
	private Date endDate;		// 有效期
	private Date signDate;		// 签订时间
	private Integer status;		// 状态
	private Consignor consignor;		// 项目
	
	public Agreement() {
		super();
	}

	public Agreement(String id){
		super(id);
	}

	@ExcelField(title="协议名称", align=2, sort=6)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@ExcelField(title="协议编号", align=2, sort=7)
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}
	
	@ExcelField(title="机构", fieldType=Office.class, value="office.name", align=2, sort=8)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}
	
	@NotNull(message="货币种类不能为空")
	@ExcelField(title="货币种类", align=2, sort=9)
	public Integer getCurrency() {
		return currency;
	}

	public void setCurrency(Integer currency) {
		this.currency = currency;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="生效时间不能为空")
	@ExcelField(title="生效时间", align=2, sort=10)
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="有效期不能为空")
	@ExcelField(title="有效期", align=2, sort=11)
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="签订时间不能为空")
	@ExcelField(title="签订时间", align=2, sort=12)
	public Date getSignDate() {
		return signDate;
	}

	public void setSignDate(Date signDate) {
		this.signDate = signDate;
	}
	
	@NotNull(message="状态不能为空")
	@ExcelField(title="状态", align=2, sort=13)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@NotNull(message="项目不能为空")
	@ExcelField(title="项目", fieldType=Consignor.class, value="", align=2, sort=14)
	public Consignor getConsignor() {
		return consignor;
	}

	public void setConsignor(Consignor consignor) {
		this.consignor = consignor;
	}
	
}